Translating tutorial/module#28
Conversation
adrianliaw
left a comment
There was a problem hiding this comment.
感謝你的翻譯!✨這邊我雖然留了 51 個 code review,但其實大概 70% 都是空格的修正以及 rST 語法的修正,也有很多都是用詞上面的統一化等 [1]。如果有不知道怎麼改或是我說明不清楚的地方,請儘量在 GitHub 上留言或是在 Telegram 群組或是私訊問我。再麻煩你修改了!
[1] 關於空格的使用請參考翻譯守則: https://github.com/python/python-docs-zh-tw#id5
| "access to in a script executed at the top level and in calculator mode)." | ||
| msgstr "" | ||
| "為了支援這一點,Python 有一種方法可以將定義放入檔案中,並在腳本或直譯器的互動" | ||
| "式實例中使用它們。這種檔案稱為\\ *模組(module)*\\ ;模組中的定義可以\\ *導" |
There was a problem hiding this comment.
我覺得 "interactive instance of the interpreter" 逐字翻會有點難懂,提議可以把「直譯器的互動式實例」改成「互動模式下的直譯器」,這樣如何?
| msgstr "" | ||
| "為了支援這一點,Python 有一種方法可以將定義放入檔案中,並在腳本或直譯器的互動" | ||
| "式實例中使用它們。這種檔案稱為\\ *模組(module)*\\ ;模組中的定義可以\\ *導" | ||
| "入(import)*\\ 到其他模組中,或是導入至 \\ *主(main)*\\ 模組(即您在最頂" |
There was a problem hiding this comment.
"import" 這個詞應該以不翻譯為主(見術語表),這邊的話我們可以寫成「import(導入)」,而後面所有使用到 import 一詞的地方我們可以直接寫 import。
另外,由於這邊的 import 是被動形式,所以應該要改成:模組中的定義可以「被」import 到其他模組中
| "為了支援這一點,Python 有一種方法可以將定義放入檔案中,並在腳本或直譯器的互動" | ||
| "式實例中使用它們。這種檔案稱為\\ *模組(module)*\\ ;模組中的定義可以\\ *導" | ||
| "入(import)*\\ 到其他模組中,或是導入至 \\ *主(main)*\\ 模組(即您在最頂" | ||
| "層、計算機模式下執行的腳本中,所使用的變數集合)。" |
There was a problem hiding this comment.
我查了一下 "calculator mode" 這個用詞,看起來 calculator mode == interactive mode [1],我覺得這樣的話翻譯裡就統一都用「互動模式」。
另外這邊語意和原文有點不太一樣,整句剖析下來應該是:
(the collection of variables that you have access to) ([in a script executed at the top level] and [in calculator mode])
所以這邊的斷句會需要修改一下。
[1] https://stackoverflow.com/questions/39240325/what-is-calculator-mode
| "to create a file called :file:`fibo.py` in the current directory with the " | ||
| "following contents::" | ||
| msgstr "" | ||
| "模組是指包含 Python 定義和語句的檔案,檔案名稱是模組名稱的字尾加上\\ :file:‘." |
There was a problem hiding this comment.
「的字尾」在這邊應該是不需要的,因為 "suffix" 是指檔案名稱的 suffix 而不是模組名稱的字尾,這邊我覺得直接把「的字尾」拿掉就和原文的意思一樣了。
另外,這邊的 rST 語法是 :file:`.py`,是 backtick 而不是 single quote。(我上次用 PoEdit 的時候它好像會自己換掉,如果你是遇到這個狀況的話請跟我說!)
| "following contents::" | ||
| msgstr "" | ||
| "模組是指包含 Python 定義和語句的檔案,檔案名稱是模組名稱的字尾加上\\ :file:‘." | ||
| "py’\\ 。在模組中,模組的名稱(作為字串)可用作全域變數\\ ``__name__``\\ 的" |
There was a problem hiding this comment.
s/可用作/會是/
另外,這邊句子中的 name 算是一個中英混雜的狀況,因此前後應該要有實際的空格。這樣的情況下,就不需要在 ``__name__`` 的前後加上倒斜線
| "可以在 Python 命令上使用命令參數(switch)\\ :option:`-O`\\ 或\\ :option:`-" | ||
| "OO`\\ 來減小已編譯模組的大小。命令參數\\ ``-O``\\ 刪除 assert 語句,\\ ``OO``" | ||
| "\\ 同時刪除 assert 語句和 __doc__ 字串。由於某些程式本身可能已經很依賴於可用" | ||
| "這些選項,因此只有在您知道自己在做什麼時,才應使用此選項。 「已優化" |
| "OO`\\ 來減小已編譯模組的大小。命令參數\\ ``-O``\\ 刪除 assert 語句,\\ ``OO``" | ||
| "\\ 同時刪除 assert 語句和 __doc__ 字串。由於某些程式本身可能已經很依賴於可用" | ||
| "這些選項,因此只有在您知道自己在做什麼時,才應使用此選項。 「已優化" | ||
| "(Optimized)」模組有\\ ``opt-``\\ 標記,且通常較小。未來的版本可能會改變優化" |
There was a problem hiding this comment.
opt- 前後應該有空格
另外,我覺得這邊這個 "Optimized" 並不是個專業術語,在原文裡使用引號也只是因為它「嚴格來說」是優化,但實質上只是把 assert 拿掉而已,並不是真的對計算效率上的改善。
| "when it is read from a ``.py`` file; the only thing that's faster about ``." | ||
| "pyc`` files is the speed with which they are loaded." | ||
| msgstr "" | ||
| "讀取\\ ``. pyc``\\ 檔案時,程式的執行速度並不會比讀取\\ ``. py``\\ 檔案快。唯" |
| "The module :mod:`compileall` can create .pyc files for all modules in a " | ||
| "directory." | ||
| msgstr "" | ||
| msgstr "模組\\ : mod: `compileall`\\ 可以為資料夾中的所有模組創建 .pyc 檔。" |
There was a problem hiding this comment.
這邊的 rST 語法需要中間沒有任何空格才能正確產生連結,另外 compileall 前後都應該有空格
| "There is more detail on this process, including a flow chart of the " | ||
| "decisions, in :pep:`3147`." | ||
| msgstr "" | ||
| msgstr "更多的細節,包括決策流程圖,請參考\\ :pep: `3147`\\ 。" |
There was a problem hiding this comment.
這邊的 rST 語法需要中間沒有任何空格,另外 pep 3147 的前面應該要有實質空格
|
I will continue from this commit, revise and complete it. |
|
closed by #72 |
目前翻譯到6.1,6.2 / 6.3 / 6.4 的翻譯還在進行中。